//引入文件操作模块
const fs = require('fs')
//读取配置文件
function readConfig(path){
    return new Promise(((resolve, reject) => {
        if(path){
            fs.readFile(path,((err, data) => {
                if(!err){
                    resolve(data)
                }else{
                    reject('读取配置文件错误')
                }
            }))
        }else{
            reject('缺少配置文件路径')
        }
    }))
}

module.exports = {readConfig}
